import {configureStore} from '@reduxjs/toolkit';
import nodesReducer from './nodesSlice';
import locationsReducer from './locationsSlice';

// 配置Redux store，默认包含了thunk中间件
export const store = configureStore({
    reducer: {
        nodes: nodesReducer,
        locations: locationsReducer,
    },
    // middleware会自动配置，包括thunk
});

// 导出类型
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;

// 导出工具函数
export {refreshNodes, refreshLocations, refreshSidebarData} from './actions';